//
//  HMDiscoverView.swift
//  微博
//
//  Created by 程双岐 on 16/9/19.
//  Copyright © 2016年 heima. All rights reserved.
//

import UIKit

class HMDiscoverView: UIView {

    @IBOutlet weak var discoverButton: UIButton!
    @IBOutlet weak var discoverTextField: UITextField!
    @IBOutlet weak var rieghtTrailing: NSLayoutConstraint!
  
    @IBAction func beginAction(_ sender: AnyObject) {
        rieghtTrailing.constant = discoverButton.width
        UIView.animate(withDuration: 0.3) { 
            self.layoutIfNeeded()
        }
        
        
    }
    
    @IBAction func buttonAction(_ sender: AnyObject) {
        discoverTextField.resignFirstResponder()
        rieghtTrailing.constant = 0
        UIView.animate(withDuration: 0.3) { 
            self.layoutIfNeeded()
        }
        
    }
    class func discoverView()-> HMDiscoverView {
        return UINib.init(nibName: "HMDiscover", bundle: nil).instantiate(withOwner: nil, options: nil).last as! HMDiscoverView
    }
    

}
